<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <!-- 基础信息 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">促销名称:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" type="text" name="row[name]" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">启用状态:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', $statusList, 1)}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">类型:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[type]', $typeList, null, ['class'=>'form-control selectpicker', 'id'=>'c-type'])}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">排序:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sort" class="form-control" type="number" name="row[sort]" value="100" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">排他:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[exclusive]', $exclusiveList, 1)}
        </div>
    </div>

    <div class="form-group" id="auto-receive-group">
        <label class="control-label col-xs-12 col-sm-2">自动领取:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[auto_receive]', $autoReceiveList, 1)}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">开始时间:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-stime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" type="text" name="row[stime]" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">结束时间:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-etime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" type="text" name="row[etime]" value="" data-rule="required">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">有效期天数:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-term_day" class="form-control" type="number" name="row[term_day]" value="0" min="0" data-rule="required">
            <div class="help-block">单位：天，0表示使用全局起止时间</div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">适用店铺:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_select('row[shop_ids][]', $shopList, null, ['class'=>'form-control selectpicker', 'multiple'=>'multiple'])}
        </div>
    </div>

    <!-- 促销条件 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">条件类型:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="form-control" disabled>
                <option>订单满XX金额满足条件</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">满金额:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" name="condition[params][amount]" placeholder="请输入满金额" min="0" data-rule="required">
        </div>
    </div>

    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">结果类型:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="form-control" disabled>
                <option>订单减指定金额</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">减金额:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" name="result[params][amount]" placeholder="请输入减金额" min="0" data-rule="required">
        </div>
    </div>

    <div id="result-container">
        <!-- 动态添加的结果项 -->
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">确定</button>
            <button type="reset" class="btn btn-default btn-embossed">重置</button>
        </div>
    </div>
</form>
